#pragma once

#include "TaskQueue.h"
#include <atomic>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/**
 * @brief The MyLogic class             逻辑处理
 */
class MyLogic
{
public:

    typedef struct _Packet
    {
        unsigned int m_dataLen = 0;
        char *m_pData = nullptr;
    } Packet;

    MyLogic();
    ~MyLogic();

    void start();

    static void threadReadBtmData(void *arg);

    static void threadBtmConvert2TopData(void *arg);

    static void threadSendTopData(void *arg);

private:
    TaskQueue<Packet> m_pBtnDataQueue;            // 底部数据队列
    TaskQueue<Packet> m_pTopDataQueue;           // 上层数据队列
    std::atomic<bool> m_isRunning;            //线程是否启动
};


